<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Clause: tsl::ah::power_of_two_growth_policy&lt; GrowthFactor &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Clause
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Chatopera Language Understanding Service.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="inherits.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacetsl.html">tsl</a></li><li class="navelem"><b>ah</b></li><li class="navelem"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">power_of_two_growth_policy</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classtsl_1_1ah_1_1power__of__two__growth__policy-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">tsl::ah::power_of_two_growth_policy&lt; GrowthFactor &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="array__growth__policy_8h_source.html">array_growth_policy.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a0a10cf1f87f76dc2254fbd97152fafd7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a0a10cf1f87f76dc2254fbd97152fafd7">power_of_two_growth_policy</a> (std::size_t &amp;min_bucket_count_in_out)</td></tr>
<tr class="separator:a0a10cf1f87f76dc2254fbd97152fafd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58c8859eb849b312919e964b3cf0672e"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a58c8859eb849b312919e964b3cf0672e">bucket_for_hash</a> (std::size_t hash) const noexcept</td></tr>
<tr class="separator:a58c8859eb849b312919e964b3cf0672e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4313be750fd9062f0b104e7d69e8e533"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a4313be750fd9062f0b104e7d69e8e533">next_bucket_count</a> () const </td></tr>
<tr class="separator:a4313be750fd9062f0b104e7d69e8e533"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48d9bdb9c10caf6771069660d1608d40"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a48d9bdb9c10caf6771069660d1608d40">max_bucket_count</a> () const </td></tr>
<tr class="separator:a48d9bdb9c10caf6771069660d1608d40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a974dc74b65f9449d21ddd53a7cbc9982"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a974dc74b65f9449d21ddd53a7cbc9982">clear</a> () noexcept</td></tr>
<tr class="separator:a974dc74b65f9449d21ddd53a7cbc9982"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a18aacc8aa137bbb65bd1bfa2616f6ba6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a18aacc8aa137bbb65bd1bfa2616f6ba6"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_mask</b></td></tr>
<tr class="separator:a18aacc8aa137bbb65bd1bfa2616f6ba6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;std::size_t GrowthFactor&gt;<br />
class tsl::ah::power_of_two_growth_policy&lt; GrowthFactor &gt;</h3>

<p>Grow the hash table by a factor of GrowthFactor keeping the bucket count to a power of two. It allows the table to use a mask operation instead of a modulo operation to map a hash to a bucket.</p>
<p>GrowthFactor must be a power of two &gt;= 2. </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="a0a10cf1f87f76dc2254fbd97152fafd7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t GrowthFactor&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">tsl::ah::power_of_two_growth_policy</a>&lt; GrowthFactor &gt;::<a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">power_of_two_growth_policy</a> </td>
          <td>(</td>
          <td class="paramtype">std::size_t &amp;&#160;</td>
          <td class="paramname"><em>min_bucket_count_in_out</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Called on the hash table creation and on rehash. The number of buckets for the table is passed in parameter. This number is a minimum, the policy may update this value with a higher value if needed (but not lower).</p>
<p>If 0 is given, min_bucket_count_in_out must still be 0 after the policy creation and bucket_for_hash must always return 0 in this case. </p>

<p><div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="classtsl_1_1ah_1_1power__of__two__growth__policy_a0a10cf1f87f76dc2254fbd97152fafd7_cgraph.png" border="0" usemap="#classtsl_1_1ah_1_1power__of__two__growth__policy_a0a10cf1f87f76dc2254fbd97152fafd7_cgraph" alt=""/></div>
<map name="classtsl_1_1ah_1_1power__of__two__growth__policy_a0a10cf1f87f76dc2254fbd97152fafd7_cgraph" id="classtsl_1_1ah_1_1power__of__two__growth__policy_a0a10cf1f87f76dc2254fbd97152fafd7_cgraph">
<area shape="rect" id="node2" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a48d9bdb9c10caf6771069660d1608d40" title="tsl::ah::power_of_two\l_growth_policy::max_bucket_count" alt="" coords="216,13,459,54"/>
</map>
</div>
</p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a58c8859eb849b312919e964b3cf0672e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t GrowthFactor&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">tsl::ah::power_of_two_growth_policy</a>&lt; GrowthFactor &gt;::bucket_for_hash </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>hash</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Return the bucket [0, bucket_count()) to which the hash belongs. If bucket_count() is 0, it must always return 0. </p>

</div>
</div>
<a class="anchor" id="a974dc74b65f9449d21ddd53a7cbc9982"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t GrowthFactor&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">tsl::ah::power_of_two_growth_policy</a>&lt; GrowthFactor &gt;::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reset the growth policy as if it was created with a bucket count of 0. After a clear, the policy must always return 0 when bucket_for_hash is called. </p>

</div>
</div>
<a class="anchor" id="a48d9bdb9c10caf6771069660d1608d40"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t GrowthFactor&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">tsl::ah::power_of_two_growth_policy</a>&lt; GrowthFactor &gt;::max_bucket_count </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Return the maximum number of buckets supported by the policy. </p>

<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classtsl_1_1ah_1_1power__of__two__growth__policy_a48d9bdb9c10caf6771069660d1608d40_icgraph.png" border="0" usemap="#classtsl_1_1ah_1_1power__of__two__growth__policy_a48d9bdb9c10caf6771069660d1608d40_icgraph" alt=""/></div>
<map name="classtsl_1_1ah_1_1power__of__two__growth__policy_a48d9bdb9c10caf6771069660d1608d40_icgraph" id="classtsl_1_1ah_1_1power__of__two__growth__policy_a48d9bdb9c10caf6771069660d1608d40_icgraph">
<area shape="rect" id="node2" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a0a10cf1f87f76dc2254fbd97152fafd7" title="tsl::ah::power_of_two\l_growth_policy::power\l_of_two_growth_policy" alt="" coords="296,5,459,61"/>
<area shape="rect" id="node3" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a4313be750fd9062f0b104e7d69e8e533" title="tsl::ah::power_of_two\l_growth_policy::next\l_bucket_count" alt="" coords="300,85,455,141"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a4313be750fd9062f0b104e7d69e8e533"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;std::size_t GrowthFactor&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html">tsl::ah::power_of_two_growth_policy</a>&lt; GrowthFactor &gt;::next_bucket_count </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Return the number of buckets that should be used on next growth. </p>

<p><div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="classtsl_1_1ah_1_1power__of__two__growth__policy_a4313be750fd9062f0b104e7d69e8e533_cgraph.png" border="0" usemap="#classtsl_1_1ah_1_1power__of__two__growth__policy_a4313be750fd9062f0b104e7d69e8e533_cgraph" alt=""/></div>
<map name="classtsl_1_1ah_1_1power__of__two__growth__policy_a4313be750fd9062f0b104e7d69e8e533_cgraph" id="classtsl_1_1ah_1_1power__of__two__growth__policy_a4313be750fd9062f0b104e7d69e8e533_cgraph">
<area shape="rect" id="node2" href="classtsl_1_1ah_1_1power__of__two__growth__policy.html#a48d9bdb9c10caf6771069660d1608d40" title="tsl::ah::power_of_two\l_growth_policy::max_bucket_count" alt="" coords="208,13,451,54"/>
</map>
</div>
</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/hat-trie/include/tsl/array-hash/<a class="el" href="array__growth__policy_8h_source.html">array_growth_policy.h</a></li>
</ul>
</div><!-- contents -->
<address class="footer">
    <small>
        &nbsp; Copyright (c) (2019-2020) &nbsp;<a href="https://www.chatopera.com">
            北京华夏春松科技有限公司
        </a>. All Rights Reserved
        &nbsp;
    </small>
</address>